$(function() {
	/*$('.skin-minimal input').iCheck({
		checkboxClass : 'icheckbox-blue',
		radioClass : 'iradio-blue',
		increaseArea : '20%'
	});*/
	resumeCheckGroup();
});
function ajaxSubmit(method, url, params){
	jQuery.ajax({  
        type : method,  
        contentType : 'application/json', 
        url : url + "?" + params,
        success : function(data) {
      	  var rsult = jQuery.parseJSON(data);
      	  if (rsult.success) {
      		  //layer.msg(rsult.message, {icon:6,time:1000});
      		  window.location.reload();
      	  } else 
      		layer.msg("提交失败!原因:" + rsult.message, {icon:5,time:1000});
        },  
        error : function(data) {  
        	layer.msg('提交失败！', {icon:5,time:1000});
        }  
    });
}
function resumeCheckGroup() {
	var checkgroups = $(".resume-check");
	$.each(checkgroups, function(j, checkgroup) {
		if($(this).val() != ""){
			var type = $(checkgroup).attr('id');
			resumeCheck($("#" + type).val(), type);
		}
		
	});
}
function resumeCheck(values, name) {
	var checkAll = $("input[name='" + name + "']");
	$.each(checkAll, function(j, check) {
		var checkValue = $(check).val();
		if (values.indexOf(checkValue) >= 0) {
			$(check).iCheck('check');
			$(check).parent().addClass("checked");
		} else {
			$(check).iCheck('uncheck');
			$(check).parent().removeClass("checked");
		}
	});
}